package factory;

/**
 * @ClassName WithFactoryPatternDemo
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2021/2/23 06:51
 * @Version 1.0
 */
public class WithFactoryPatternDemo {
	public interface Product{
		void exec();
	}

	public static class ProductImpl implements Product{

		public ProductImpl() {

		}

		@Override
		public void exec() {
			System.out.println("具体业务实现");
		}
	}

	public static class ProductFactory{

		public static Product createProduct() {
			return new ProductImpl();
		}
	}

	public static void main(String[] args) {
		Product product = ProductFactory.createProduct();
		product.exec();
	}
}
